package com.dlg.user.domain.user;

import com.dlg.user.domain.basic.BasicDomain;
import com.dlg.commons.enums.UserType;

/**
 * 用户
 * 
 * @author martin_duan@yeah.net
 * @since 2017-03-19
 *
 */
public class OjUser extends BasicDomain {

	private static final long serialVersionUID = 1L;

	/**
	 * 用户名
	 */
	private String username;

	/**
	 * 盐
	 */
	private String salt;
	/**
	 * 手机号
	 */
	private String phone;

	/**
	 * 手机设备识别码
	 */
	private String imei;

	/**
	 * 邮箱
	 */
	private String email;

	/**
	 * 微信号
	 */
	private String weChat;

	/**
	 * QQ号
	 */
	private String oicq;

	/**
	 * 密码
	 */
	private String password;

	/**
	 * 用户类型
	 */
	private UserType type;

	/**
	 * 用户状态(0.新建,1.正常,2.冻结)
	 */
	private Short status;

	/**
	 * 审核状态(0.未审核,1.审核中,2.审核通过,3.审核失败)
	 */
	private Short auditStatus;

	/**
	 * 注册来源
	 */
	private String origin;

	/**
	 * 消息推送标示
	 */
	private String messageSendIdentify;
	
	/**
	 * 微信分享时openId
	 */
	private String openId;

	private OjUserPersonalAttribute userPersonalAttribute;

	OjUserEnterpriseAttribute userEnterpriseAttribute;

	public String validate(){
		if (this==null) {
			return "要保存的对象为空";
		}
		if (null == type) {
			return "用户类型为空";
		}
		if (!UserType.PERSONAL.equals(type) && !UserType.ENTERPRISE.equals(type)) {
			return "用户类型非法";
		}
		return null;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getImei() {
		return imei;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getWeChat() {
		return weChat;
	}

	public void setWeChat(String weChat) {
		this.weChat = weChat;
	}

	public String getOicq() {
		return oicq;
	}

	public void setOicq(String oicq) {
		this.oicq = oicq;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public UserType getType() {
		return type;
	}

	public void setType(UserType type) {
		this.type = type;
	}

	public Short getStatus() {
		return status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	public Short getAuditStatus() {
		return auditStatus;
	}

	public void setAuditStatus(Short auditStatus) {
		this.auditStatus = auditStatus;
	}

	public String getOrigin() {
		return origin;
	}

	public void setOrigin(String origin) {
		this.origin = origin;
	}

	public String getMessageSendIdentify() {
		return messageSendIdentify;
	}

	public void setMessageSendIdentify(String messageSendIdentify) {
		this.messageSendIdentify = messageSendIdentify;
	}
	
	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public OjUserPersonalAttribute getUserPersonalAttribute() {
		return userPersonalAttribute;
	}

	public void setUserPersonalAttribute(OjUserPersonalAttribute userPersonalAttribute) {
		this.userPersonalAttribute = userPersonalAttribute;
	}

	public OjUserEnterpriseAttribute getUserEnterpriseAttribute() {
		return userEnterpriseAttribute;
	}

	public void setUserEnterpriseAttribute(OjUserEnterpriseAttribute userEnterpriseAttribute) {
		this.userEnterpriseAttribute = userEnterpriseAttribute;
	}
}
